package windowBuilderExample;

import java.awt.EventQueue;

import javax.swing.*; 
import java.awt.*; 
import javax.swing.border.*;   
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.UIManager;
import javax.swing.LayoutStyle.ComponentPlacement;

public class UiExerciseFirstLayoutMager {

	private JFrame frame;
	private JPanel topCenterPanel;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField_6;
	private JTextField textField_7;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UiExerciseFirstLayoutMager window = new UiExerciseFirstLayoutMager();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public UiExerciseFirstLayoutMager() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 692, 639);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(new BorderLayout(0, 0));
		
		topCenterPanel = new JPanel();
		topCenterPanel.setBorder(new TitledBorder(null, "Genes", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		frame.getContentPane().add(topCenterPanel);
		
		JTextArea textArea = new JTextArea();
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Gene Information", TitledBorder.LEADING, TitledBorder.TOP, null, null), "Gene Information", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		
		JButton button = new JButton("+");
		
		JButton button_1 = new JButton("-");
		GroupLayout gl_topCenterPanel = new GroupLayout(topCenterPanel);
		gl_topCenterPanel.setHorizontalGroup(
			gl_topCenterPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_topCenterPanel.createSequentialGroup()
					.addContainerGap()
					.addComponent(textArea, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
					.addGroup(gl_topCenterPanel.createParallelGroup(Alignment.LEADING, false)
						.addGroup(gl_topCenterPanel.createSequentialGroup()
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(panel, GroupLayout.PREFERRED_SIZE, 232, GroupLayout.PREFERRED_SIZE))
						.addGroup(gl_topCenterPanel.createSequentialGroup()
							.addGap(87)
							.addComponent(button)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(button_1, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap())
		);
		gl_topCenterPanel.setVerticalGroup(
			gl_topCenterPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_topCenterPanel.createSequentialGroup()
					.addGroup(gl_topCenterPanel.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_topCenterPanel.createSequentialGroup()
							.addContainerGap()
							.addComponent(panel, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(gl_topCenterPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(button)
								.addComponent(button_1)))
						.addGroup(gl_topCenterPanel.createSequentialGroup()
							.addGap(7)
							.addComponent(textArea, GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE)))
					.addContainerGap())
		);
		panel.setLayout(new GridLayout(0, 2, 4, 4));
		
		textField = new JTextField();
		panel.add(textField);
		textField.setColumns(10);
		
		textField_1 = new JTextField();
		panel.add(textField_1);
		textField_1.setColumns(10);
		
		textField_2 = new JTextField();
		panel.add(textField_2);
		textField_2.setColumns(10);
		
		textField_3 = new JTextField();
		panel.add(textField_3);
		textField_3.setColumns(10);
		
		textField_4 = new JTextField();
		panel.add(textField_4);
		textField_4.setColumns(10);
		
		textField_5 = new JTextField();
		panel.add(textField_5);
		textField_5.setColumns(10);
		
		textField_6 = new JTextField();
		panel.add(textField_6);
		textField_6.setColumns(10);
		
		textField_7 = new JTextField();
		panel.add(textField_7);
		textField_7.setColumns(10);
		topCenterPanel.setLayout(gl_topCenterPanel);
	}  
}
